--[[
    * Author:Dzlua
    * QQ:505544956
    * time:2016/06/27
--]]

-- add target
target("edui")

    -- 动态库
    set_kind("$(kind)")
    
    if is_kind("static") then
        -- 添加宏定义
        add_defines_h("$(prefix)_USE_STATIC")
    else
        add_defines_h("$(prefix)_USE_SHARED")
    end

    -- add defines
    add_defines("EDUI_EXPORTS")

    -----------------

    -- set the object files directory
    set_objectdir("$(buildir)/.objs")

    -- set the auto-generated config.h
    set_config_h("$(buildir)/edui/config.h")
    set_config_h_prefix("EDUI")

    ----------------
    
    -- add packages
    add_packages("SDL2","SDL2_image","SDL2_ttf","pcre")

    ----------------

     -- 设置输出头文件目录
    set_headerdir("$(buildir)/edui")

    -----------------

    -- add the header files for installing
    add_headers("../edui/(**.h)|lua/**.h|core/LuaMgr.h")
    -----------------

    -- add includes directory
    add_includedirs("../")
    -- include build/edui/config.h
    add_includedirs("$(buildir)/edui")

    -----------------

    -- add files
    add_files("../edui/**.cpp|lua/**.cpp|core/LuaMgr.cpp","../edui/**.cc")
    add_files("src/**.cpp","external/**.c")

    -----------------

    add_options("use-lua")
    add_options("test-new-delete")
    add_options("test-mouse-control")

    if is_option("use-lua") then
        add_packages("LuaPlus")
    end

    if is_option("use-lua") and is_option("LuaPlus") then
        add_headers("../edui/(core/LuaMgr.h)")
        add_files("../edui/lua/**.cpp","../edui/core/LuaMgr.cpp");
        add_defines_h("$(prefix)_USE_LUAPLUS")
    end

    if is_option("test-new-delete") then
        add_defines_h("$(prefix)_TEST_NEW_DELETE")
    end

    if is_option("test-mouse-control") then
        add_defines_h("$(prefix)_TEST_MOUSE_CONTROL")
    end
    